﻿# Specify the project name and languages
set(MY_PROJECT_NAME encode_dlm_seg_v2_o)
project(${MY_PROJECT_NAME} LANGUAGES CXX)

# Set compiler options for MSVC to use UTF-8 encoding
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

# Add include directories for libraries
include_directories(
	${BOOST_INCLUDEDIR}
	${MY_YAML_INCLUDE_DIR}
	${MY_CRYPTOPP_INCLUDE_DIR}
	${MY_OPENVINO_INCLUDE_DIR}
)

# Specify library directories for linking
link_directories(
	${MY_YAML_LIB_DIR}
	${Boost_LIBRARY_DIRS}
	${MY_CRYPTOPP_LIB_DIR}
	${MY_OPENVINO_LIB_DIR}
)

# Set libraries to link against
set(O_ENCODE_DLM_LIBS
	${MY_YAML_LIB} dxgi
	${MY_CRYPTOPP_LIB}
	${MY_OPENVINO_LIBS}
)

# Gather header and source files
file(GLOB CURRENT_HEADERS  *.h *.hpp)
file(GLOB CURRENT_SOURCES  *.cpp)
source_group("Include" FILES ${CURRENT_HEADERS}) 
source_group("Source" FILES ${CURRENT_SOURCES})

# Create the executable target
add_executable(${MY_PROJECT_NAME}
	${CURRENT_HEADERS}
	${CURRENT_SOURCES}
	"./common/device_utility.h"
	"./common/device_utility.cpp"
)

# Link the libraries to the executable
target_link_libraries(${MY_PROJECT_NAME} PRIVATE
	${O_ENCODE_DLM_LIBS})

# Set environment variables for the executable
set(MY_PATH "PATH=%PATH%" 
	${MY_CRYPTOPP_BIN_DIR} 
	${MY_YAML_BIN_DIR}
	${MY_OPENVINO_BIN_DIR}
	${MY_IPP_BIN_DIR}
)

# Set debugger environment for the executable
set_property(TARGET ${MY_PROJECT_NAME} PROPERTY VS_DEBUGGER_ENVIRONMENT ${MY_PATH})

# Install the executable
install(TARGETS ${MY_PROJECT_NAME} DESTINATION bin)
